package com.sgb.kjwl.view.ui.adapter.pick;

import android.content.Context;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.ShowList;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class PickHomeHotChildAdapter extends BaseRecycleAdapter<ShowList> {

    private TextView tv_line;
    private LinearLayout ll_gc;
    private LinearLayout ll_goods;
    private int type;

    public PickHomeHotChildAdapter(Context context, List<ShowList> datas, int type) {
        super(context, R.layout.item_pick_home_hot_child, datas);
        this.type = type;
    }

    @Override
    public void convert(ItemViewHolder holder, final ShowList entity) {
        holder.setBinding(BR.viewModel, entity);
        tv_line = holder.itemView.findViewById(R.id.tv_line);
        ll_gc = holder.itemView.findViewById(R.id.ll_gc);
        ll_goods = holder.itemView.findViewById(R.id.ll_goods);
        if (holder.getPosition() == datas.size() - 1)
            tv_line.setVisibility(View.GONE);
        if (type == 0) {
            ll_gc.setVisibility(View.VISIBLE);
        } else {
            ll_goods.setVisibility(View.VISIBLE);
        }

    }
}
